

ENT.Type = "anim"
ENT.Base = "base_anim"

ENT.PrintName		= ""
ENT.Author			= ""
ENT.Contact			= ""
ENT.Purpose			= ""
ENT.Instructions	= ""


function ENT:FakeInit()
    
end

function ENT:GetTeam()
    return self:GetNetworkedInt("team")
end 

ENT.Team = ENT.GetTeam



function ENT:IsBuilding()
    return self:GetNWBool( "b", false )
end

function ENT:FWOwner()
    return self:GetNetworkedEntity("owner")
end

function ENT:PercentComplete()

    if NicanSettings.BuildersPercentIsHealth == true then
        return self:FWHealth() / self.MaxHealth
    end
    
    return 
    
end

function ENT:GetDeleteVotes()
    return self:GetNetworkedInt("Rvotes",0)
end


function ENT:GetOriginalColor()

    if NicanSettings.BlockColorTeam == true then
        return  self.Color.r, self.Color.g, self.Color.b, self.Color.a
    end

    return 255,255,255,255
end

function ENT:RefreshColor()
    local r,g,b,a = self:GetOriginalColor()

    local Percent = 0.2 + self:FWHealth() / self.MaxHealth * 0.8

    
    if NicanSettings.BlockBlackHealth then
        r = r * Percent
        g = g * Percent
        b = b * Percent
    end
    
    if self:GetNWBool( "b" ) == true then
        if NicanSettings.BuildersPercentIsHealth == true then
            a = a * Percent
        else
            a = self:GetNWInt( "b%" )
        end
    end
    
    self:SetColor( r, g, b, a )    
end
